import { request } from '@umijs/max';

// 获取客户合同列表
export async function getCustomerContracts(params) {
  return request('/api/customer-contracts', {
    method: 'GET',
    params,
  });
}

// 创建客户合同
export async function createCustomerContract(data) {
  return request('/api/customer-contracts', {
    method: 'POST',
    data,
  });
}

// 更新客户合同
export async function updateCustomerContract(id, data) {
  return request(`/api/customer-contracts/${id}`, {
    method: 'PUT',
    data,
  });
}

// 删除客户合同
export async function deleteCustomerContract(id) {
  return request(`/api/customer-contracts/${id}`, {
    method: 'DELETE',
  });
}

// 解约合同
export async function terminateContract(id) {
  return request(`/api/customer-contracts/${id}/terminate`, {
    method: 'POST',
  });
}
